package com.jdkreader.concurrency.concurrent.simulation;

import java.util.concurrent.ArrayBlockingQueue;


/**
 * 模拟顾客排队
 */
public class CustomerLine extends ArrayBlockingQueue<Customer> {

    public CustomerLine(int maxSize){
        super(maxSize);
    }
    public String toString(){
        if(this.size() == 0){
            return "[Empty]";
        }
        StringBuilder result=new StringBuilder();
        for(Customer customer:this){
            result.append(customer);
        }
        return result.toString();
    }
}
